package com.itce.arco.practicenote.day02.practice3;

public class SalesPerson {
    public void sell(Car car) {
        // 输出宝马车系的gps导航系统
        if(car instanceof BMWCar) {
            IGps iGps = (BMWCar) car;
            iGps.useIGps();
        } else if (car instanceof BMWSUV) {
            IGps iGps = (BMWSUV)car;
            iGps.useIGps();
        }
    }
    public Car sell(int i) {
        switch(i) {
            case 1:
                return new BenzCar();
            case 2:
                return new BenzSUV();
            case 3:
                return new BMWCar();
            case 4:
                return new BMWSUV();
            default:
                System.out.println("参数错误！");
                return null;
        }
    }
}
